package lowlevel;

import java.util.HashMap;
import java.util.UUID;

/**
 * @Author:RenPu
 * @Date: 2020/3/27 16:43
 * @Version: 1.0
 * @description:
 */
public class LamdaTest {
    public static void main(String[] args) {

        HashMap<String, Long> map = new HashMap<>();

        String[] t1={"hello","world","hello","java","hello","python","hello","li","ming"};


        for (String s : t1) {

            Long num=map.getOrDefault(s,0L);

            num++;

            map.put(s,num);
            
        }


        map.forEach((key,value)->{
            System.out.println(key+"------------"+value);
        });
        
















//        for (int i = 0; i < 10; i++) {
//            String uuid = UUID.randomUUID().toString();
//            String uuid2 = UUID.randomUUID().toString();
//            map.put(uuid,uuid2);
//
//        }


//        map.forEach((key,vale)->{
//            System.out.println(key+"-----"+vale);
//
//        });



    }
}
